package com.cd.music.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author yxl 余秀良
 * @version 1.0
 * @description: 商品实体类
 * @date 2018年03月01日  下午10:59
 * @address: 四川成都
 */
@Entity
@Table
public class Goods {
    /**
     * 数据id
     */
    @Id
    @Column(nullable = false, unique = true, length = 32)
    private String id;
    /**
     * 商品名字
     */
    @Column(nullable = false, length = 50)
    private String name;
    /**
     * 商品价格
     */
    @Column(nullable = false, length = 8, columnDefinition = "decimal(6,2) default 399.00")
    private BigDecimal price;
    /**
     * 商品类别
     */
    @Column(length = 32)
    private String typeId;
    /**
     * 创建时间
     */
    @Column(columnDefinition = "datetime default now()")
    private Date createTime;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    public Date getCreateTime() {
        return createTime != null ? (Date) createTime.clone() : null;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime != null ? (Date) createTime.clone() : null;
    }

}
